#include <iostream>
#include <windows.h>
using namespace std;

typedef struct
{
	int re;
	int im;
}AComplex;


void Adispaly(AComplex A)
{
	cout << A.re << " + " << A.im << "i" << endl;
	
}

AComplex add(AComplex A, AComplex B )
{
	A.re = A.re + B.re;
	A.im = A.im + B.im;

	return A;
}

AComplex subtract(AComplex A, AComplex B)
{
	A.re = A.re - B.re;
	A.im = A.im - B.im;

	return A;
}

AComplex multiply(AComplex A, AComplex B)
{
	AComplex C;
	C.re = A.re * B.re - A.im* B.im;
	C.im = A.re * B.im + A.im * B.re;
	return C;
}

int main()
{
	AComplex A,B;
	A.re = 2;
	A.im = 3;
	B.re = 4;
	B.im = 5;
	Adispaly(A);
	Adispaly(B);
	Adispaly(add(A, B));
	Adispaly(subtract(A, B));
	Adispaly(multiply(A, B));
	return 0;
}